﻿@namespace Masa.Docs.Shared.Components

@if (!string.IsNullOrWhiteSpace(RepoUrl))
{
    <AppTooltipButton Href="@RepoUrl"
                      Target="_blank"
                      Icon="mdi-github"
                      Path="github"
                      Class="mx-1">
    </AppTooltipButton>
}

@if (RepoUrl?.Contains("MASA.Blazor", StringComparison.OrdinalIgnoreCase) is true && Culture == "zh-CN")
{
    <AppTooltipButton Href="https://gitee.com/blazorcomponent/MASA.Blazor"
                      Target="_blank"
                      Icon="M512 1024C230.4 1024 0 793.6 0 512S230.4 0 512 0s512 230.4 512 512-230.4 512-512 512z m259.2-569.6H480c-12.8 0-25.6 12.8-25.6 25.6v64c0 12.8 12.8 25.6 25.6 25.6h176c12.8 0 25.6 12.8 25.6 25.6v12.8c0 41.6-35.2 76.8-76.8 76.8h-240c-12.8 0-25.6-12.8-25.6-25.6V416c0-41.6 35.2-76.8 76.8-76.8h355.2c12.8 0 25.6-12.8 25.6-25.6v-64c0-12.8-12.8-25.6-25.6-25.6H416c-105.6 0-188.8 86.4-188.8 188.8V768c0 12.8 12.8 25.6 25.6 25.6h374.4c92.8 0 169.6-76.8 169.6-169.6v-144c0-12.8-12.8-25.6-25.6-25.6z"
                      IconSvgAttrs="@(new Dictionary<string, object?>() { { "viewBox", "0 0 1024 1024" } })"
                      Path="gitee"
                      Class="mx-1">
    </AppTooltipButton>
}

<AppTooltipButton OnClick="@OnSettingsClick"
                  Icon="mdi-cog-outline"
                  Path="settings">
</AppTooltipButton>

@code {

    [CascadingParameter(Name = "Culture")]
    public string? Culture { get; set; }

    [Parameter]
    public string? RepoUrl { get; set; }

    [Parameter]
    public EventCallback OnSettingsClick { get; set; }

}
